import json


# 问题模版

class Question:
    def __init__(self,question_text):
        # 问题名称
        self.question_text = question_text
        # 问题答案
        self.flag=0


    # 设置问题名
    def set_question_text(self, question_text):
        self.question_text = question_text
        return question_text

    # 获取问题名
    def get_question_text(self):
        return self.question_text

    # 设置选项
    def set_flag(self, flag):
        self.flag = flag
        return flag

    # 获取对错
    def get_flag(self):
        return self

    # 转换为JSON
    def get_question_json_formate(self):
        return json.dumps({"question_text":self.question_text,
                           "flag":self.flag})